<template>
  <!-- 项目默认主页 -->
  <div class="en_container">
    主页主页
    <div>页面标题:<el-input v-model="input" style="width: 240px" placeholder="Please input" /></div>

    <el-button @click="openNewtab">打开新标签</el-button>
  </div>
</template>
<script setup>
import { nextTick, onMounted, ref, watch } from 'vue'
import { useRouterStore } from '@/stores/modeles/router'
import { getUUID } from '@/utils/index.js'

const input = ref('')
const routerStore = useRouterStore()

//打开新标签示例
const openNewtab = () => {
  routerStore.addTab({
    menuId: getUUID(), //唯一id
    menuName: input.value, //标签名称
    menuUrl: '/detail', //路由path
    query: {
      name: input.value,
    }, //传参
  })
}
</script>

<style lang="scss" scoped>
.en_container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
</style>